﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Maticsoft.DBUtility;

namespace ElingOA6_DSJCJ.DAL
{
    /// <summary>
    /// 信息文档接收对象 数据类
    /// </summary>
    public class DocRecObject
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public DocRecObject()
        {
        }
        /// <summary>
        /// 是否存在该记录
        /// <creator>wangl</creator>
        /// <date>2013-08-02</date> 
        /// </summary>
        /// <param name="entityNo">公司编号</param>
        /// <param name="docClsCd">信息类别</param>
        /// <returns>true-存在 false-不存在</returns>
        public bool Exists(string entityNo, decimal docId,string empNo)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select FDocId from t_docRecObject");
            strSql.Append(" where FEntityNo=@FEntityNo and FDocId=@FDocId AND FEmplNo=@FEmplNo ");

            SqlParameter[] parameters = {
					new SqlParameter("@FEntityNo", SqlDbType.NVarChar,50),
					new SqlParameter("@FDocId", SqlDbType.Decimal,9),
                    new SqlParameter("@FEmplNo", SqlDbType.NVarChar,15)                    
                                        };
            parameters[0].Value = entityNo;
            parameters[1].Value = docId;
            parameters[2].Value = empNo;
            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }
    }
}
